/*****************************************************************************/
/* Step 0. Preparations/Declarations                                         */
/*****************************************************************************/
SET NOCOUNT OFF

/*****************************************************************************/
/* Step 1. Remove stored procedure if it already exists                      */
/*****************************************************************************/
IF (SELECT OBJECT_ID('[Kernel].PersonWith')) IS NOT NULL
BEGIN
  DROP PROCEDURE [Kernel].[PersonWith]
END

GO

/*****************************************************************************/
/* Step 2. Create stored procedure                                           */
/*****************************************************************************/
CREATE PROCEDURE [Kernel].[PersonWith]( @PersonOID BIGINT )
AS 
BEGIN

	SELECT OID, 
	Version, 
	FirstName, 
	LastName, 
	MiddleInitial, 
	DOB, 
	Sex, 
	Phone1, 
	Phone2, 
	eMailAddress 
	From People
	Where OID = @PersonOID

END

GO
/******************************************************************************/
/* Step 3. Assign appropriate permissions                                     */
/******************************************************************************/
GRANT EXECUTE ON [Kernel].[PersonWith] TO [Liberty_Users]
GO
-- Developers and Admins have permissions to execute through membership         